// lms - application - account settings
// ====================

// Table of Contents
// * +Container - Account Settings
// * +Main - Header
// * +Settings Section


// +Container - Account Settings
.wrapper-account-settings {
    background: $white;
    width: 100%;

    .account-settings-container {
        max-width: grid-width(12);
        padding: 10px;
        margin: 0 auto;
    }

    .ui-loading-indicator,
    .ui-loading-error {
         @extend .ui-loading-base;
         // center horizontally
         @include margin-left(auto);
         @include margin-right(auto);
         padding: ($baseline*3);

         text-align: center;

        .message-error {
            color: $alert-color;
        }
    }
}

// +Main - Header
.wrapper-account-settings {

    .wrapper-header {
        max-width: grid-width(12);
        height: 139px;
        border-bottom: 4px solid $m-gray-l4;

        .header-title {
            @extend %t-title4;
            margin-bottom: ($baseline/2);
            padding-top: ($baseline*2);
        }

        .header-subtitle {
            color: $gray-l2;
        }

        .account-nav {
            @include float(left);
            margin: ($baseline/2) 0;
            padding: 0;
            list-style: none;

            .account-nav-link {
                @include float(left);
                font-size: em(14);
                color: $gray;
                padding: 5px 25px 23px;
                display: inline-block;
                box-shadow: none;
                border: none;
                border-radius: 0;
                background: transparent none;
            }

            button {
                @extend %ui-clear-button;
                @extend %btn-no-style;
                @include appearance(none);
                display:block;
                padding: ($baseline/4);

                &:hover,
                &:focus {
                    text-decoration: none;
                    border-bottom: 4px solid $courseware-border-bottom-color !important;
                }
                &.active{
                    border-bottom: 4px solid $black-t3 !important;
                }
            }
        }
    }
}

// +Settings Section
.account-settings-sections {

    .section-header {
        @extend %t-title6;
        @extend %t-strong;
        padding-top: ($baseline/2)*3;
        color: $dark-gray1;
    }

    .section {
        background-color: $white;
        margin-top: $baseline;
        border-bottom: 4px solid $m-gray-l4;

        .account-settings-header-subtitle {
            font-size: em(18);
            line-height: normal;
            color: $dark-gray;
            padding-top: 20px;
            padding-bottom: 10px;
        }

        .account-settings-section-body {

            .u-field {
                border-bottom: 2px solid $m-gray-l4;

                .field {
                    width: 30%;
                    vertical-align: top;
                    display: inline-block;
                    position: relative;

                    select {
                        @include appearance(none);
                        padding: 14px 30px 14px 15px;
                        border: 1px solid $light-gray;
                        background-color: transparent;
                        border-radius: 2px;
                        position: relative;
                        z-index: 10;
                        &::-ms-expand{
                            display: none;
                        }
                        ~ .icon-caret-down{
                            &:after{
                                content: "";
                                border-left: 6px solid transparent;
                                border-right: 6px solid transparent;
                                border-top: 7px solid $blue;
                                position: absolute;
                                right: 10px;
                                bottom: 20px;
                                z-index: 0;
                            }
                        }
                    }
                    .field-label {
                        display: block;
                        width: auto;
                        margin-bottom: 0.625rem;
                        font-size: 1rem;
                        line-height: 1;
                        color: $dark-gray;
                    }

                    .field-input {
                        @include transition(all 0.125s ease-in-out 0s);
                        display: inline-block;
                        padding: 0.625rem;
                        border: 1px solid $light-gray;
                        border-radius: 2px;
                        background: $white;
                        font-size: $body-font-size;
                        color: $dark-gray;
                        width: 100%;
                        height: 48px;
                        box-shadow: none;
                    }

                    .u-field-link {
                        @extend %ui-clear-button;

                        // set styles
                        @extend %btn-pl-default-base;
                        @include font-size(18);
                        width: 100%;
                        border: 1px solid $blue;
                        color: $blue;
                        padding: 11px 14px;
                        line-height: normal;
                    }

                    #u-field-value-username {
                        padding-top: ($baseline/2);
                    }
                }

                .u-field-order {
                    display: flex;
                    align-items: center;
                    font-size: em(16);
                    color: $gray;
                    width: 100%;
                    padding-top: $baseline;
                    padding-bottom: $baseline;
                    line-height: normal;

                    span {
                        padding: $baseline;
                    }

                    .u-field-order-title {
                        @include float(left);
                        width: 26%;
                        font-size: em(20);
                        padding-left: ($baseline*2);
                    }

                    .u-field-order-value {
                        @include float(left);
                        width: 12%;
                    }

                    .u-field-order-date {
                        @include float(left);
                        width: 16%;
                    }

                    .u-field-order-link {
                        width: 15%;
                        padding: 0;

                        .u-field-link {
                            @extend %ui-clear-button;
                            @extend %btn-pl-default-base;
                            @include font-size(14);
                            border: 1px solid $blue;
                            color: $blue;
                            line-height: normal;
                            padding: 10px;
                            width: 110px;
                        }
                    }
                }

                .social-field-linked {
                    background: $m-gray-l4;
                    box-shadow: 0 1px 2px 1px $shadow-l2;
                    padding: 1.25rem;
                    box-sizing: border-box;
                    margin: 10px;
                    width: 100%;

                    .field-label {
                        @include font-size(24);
                    }

                    .u-field-social-help {
                        display: inline-block;
                        padding: 20px 0 6px;
                    }

                    .u-field-link {
                        @include font-size(14);
                        @include text-align(left);
                        border: none;
                        margin-top: $baseline;
                        font-weight: $font-semibold;
                        padding: 0;

                        &:focus, &:hover, &:active {
                            background-color: transparent;
                            color: $m-blue-d3;
                            border: none;
                        }
                    }
                }

                .social-field-unlinked {
                    background: $m-gray-l4;
                    box-shadow: 0 1px 2px 1px $shadow-l2;
                    padding: 1.25rem;
                    box-sizing: border-box;
                    text-align: center;
                    margin: 10px;
                    width: 100%;

                    .field-label {
                        @include font-size(24);
                        text-align: center;
                    }

                    .u-field-link {
                        @include font-size(14);
                        margin-top: $baseline;
                        font-weight: $font-semibold;
                    }
                }
                
                .u-field-message {
                    position: relative;
                    padding: 24px 0 0 ($baseline*5);

                    .u-field-message-notification {
                        position: absolute;
                        left: 0;
                        top: 0;
                        bottom: 0;
                        margin: auto;
                        padding: 38px 0 0 ($baseline*5);
                    }
                }

                &:last-child {
                    border-bottom: none;
                    margin-bottom: ($baseline*2);
                }
            }

            .u-field-orderHistory {
                border-bottom: none;
                border: 1px solid $m-gray-l4;
                margin-bottom: $baseline;
                padding: 0;

                &:last-child {
                    border-bottom: 1px solid $m-gray-l4;
                }

                &:hover, &:focus {
                    background-color: $light-gray4;
                }
            }

            .u-field-order-orderId {
                border: none;
                margin-top: $baseline;
                margin-bottom: 0;
                padding-bottom: 0;

                &:hover, &:focus {
                    background-color: transparent;
                }

                .u-field-order {
                    font-weight: $font-semibold;
                    padding-top: 0;
                    padding-bottom: 0;

                    .u-field-order-title {
                        font-size: em(16);
                    }
                }
            }

            .u-field-social {
                border-bottom: none;
                margin-right: 20px;
                width: 30%;
                display: inline-block;
                vertical-align: top;

                .u-field-social-help {
                    @include font-size(12);
                    color: $m-gray-d1;
                }
            }
        }

        &:last-child {
            border-bottom: none;
        }
    }
}
